import axios from "../../http/axios.js";
import {
  apiGetHospitalList,
  apiGetHospitalListByServiceId
} from "../../http/server.js";

export default function getHospitalList(option) { //公共获取公告的接口
  return new Promise((resolve, reject) => {
    axios({
        url: apiGetHospitalList,
        data: {
          page: option.page,
          pageSize: option.pageSize,
          serviceId: option.serviceId || ""
        }
      })
      .then(res => {
        resolve(res)
      })
  })
}

export function getHospitalListByServiceId(option) {
  return new Promise((resolve, reject) => {
    axios({
        url: apiGetHospitalListByServiceId,
        data: {
          page: option.page,
          pageSize: option.pageSize,
          serviceIds: option.serviceId || ""
        }
      })
      .then(res => {
        resolve(res)
      })
  })
}